//
//  LBCollectionViewCell.m
//  UIHomeWork14_礼物说分类攻略界面
//
//  Created by tusm on 16/8/3.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "LBCollectionViewCell.h"
@interface LBCollectionViewCell ()
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *contentLabel;

@end
@implementation LBCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        CGFloat width = CGRectGetWidth(frame);
        CGFloat height = CGRectGetHeight(frame);
        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, width, height)];
        _imageView.backgroundColor = [UIColor colorWithRed:arc4random() % 256 / 255.0f  green:arc4random() % 256 / 255.0f blue:arc4random() % 256 / 255.0f alpha:1];
        _imageView.layer.cornerRadius = 4;
        _imageView.layer.masksToBounds = YES;
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, height / 4, width - 40, 20)];
        _contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, height / 4 + 25 , width - 40, 20)];
        _titleLabel.text = @"礼物";
        _contentLabel.text = @"专治送礼困难症";
        _contentLabel.font = [UIFont systemFontOfSize:14];
        _contentLabel.textColor = [UIColor grayColor];
        [self addSubview:_imageView];
        [_imageView addSubview:_titleLabel];
        [_imageView addSubview:_contentLabel];
    }
    return self;
    
}

@end
